/** @format */

import events from "events";
import express from "express";
import path from "path";
// import cookieParser from "cookie-parser";
// import logger from "morgan";

import indexRouter from "./routes/index";
import usersRouter from "./routes/users";

var app = express();
events.EventEmitter.defaultMaxListeners = 0;

// app.use(logger("dev"));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
// app.use(cookieParser());
app.use(express.static(path.join(__dirname, "public")));

app.use("/", indexRouter);
app.use("/users", usersRouter);

export { app as default };
